#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include<QPixmap>
#include <QDebug>
#include<QMessageBox>
#include <QtCharts/QChartView>
#include <QtCharts/QLineSeries>
#include <QtWidgets/QApplication>
#include <QtWidgets/QMainWindow>

#include <QTcpSocket>
#include <QTimer>
#include <QPixmap>
#include <QVBoxLayout>

#include <QHostAddress>
#include <QHostInfo>
#include <QNetworkInterface>
#include "landdialog.h"
#include "paint.h"
#include "videothread.h"

QT_CHARTS_USE_NAMESPACE

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

    void view();
    int flag;

    void sendmaxmin();

    void sendadmin();

    void send_info_to_server(); //发送消息给server

    void wheelEvent(QWheelEvent *event); //实现鼠标滚轮事件

    void mousePressEvent(QMouseEvent *event);

    void mouseReleaseEvent(QMouseEvent *event);
//    void mousePressEvent(QMouseEvent *event);

private slots:
    void on_to_page11_clicked();

    void on_to_page13_clicked();

    void on_pushButton_return_clicked();

    void set_chartView_slots();

    void on_return_pg12_clicked();

    void freshdata_slot();

    void on_back_to_page12_clicked();

    void on_save_in_page11_clicked();
	
	void set_chartView_2_slots();

    void set_chartView_3_slots();
	
	void on_fllush_clicked();

    void on_set_option_clicked();

    void on_airFan_open_2_clicked();

    void on_sunshade_open_2_clicked();

    void on_sprayWater_open_2_clicked();

    void on_pushButton_clicked();

    void on_pushButton_auto_clicked();

//    void DisplayMsgslot(QString);

    void DisplayMovieSlot();

private:
    Ui::Widget *ui;
    QMovie *movie;
    QPixmap map;
    QTimer timer;
    int log = 1;
    char send_buf[FLAG_SIZE];

    paint *pic;   //画图对象
    videothread *VDthread;
    QPixmap pix;

};

#endif // WIDGET_H
